
export const policyMinxin = {
  data(){
    return {
      // 优惠方式字典
      preferentialMethodOptions: [],
      // 折后抹零字典
      wipeOffOptions: [],
      // 分摊方式字典
      sharingMethodOptions: [],
      // 优惠类型字典
      preferentialTypeOptions: [],
      // 折扣方式字典
      discountMethodOptions: [],
      // 减免方式字典
      reliefMethodOptions: [],
      // 赠送方式字典
      largessMethodOptions: [],
      // 系统类型字典
      systemTypeOptions: [],
      // 状态字典
      statusOptions: [],
    }
  },
  created() {
    this.getDicts("preferential_method").then(response => {
      this.preferentialMethodOptions = response.data;
    });
    this.getDicts("wipe_off_method").then(response => {
      this.wipeOffOptions = response.data;
    });
    this.getDicts("sharing_method").then(response => {
      this.sharingMethodOptions = response.data;
    });
    this.getDicts("preferential_type").then(response => {
      this.preferentialTypeOptions = response.data;
    });
    this.getDicts("discount_method").then(response => {
      this.discountMethodOptions = response.data;
    });
    this.getDicts("relief_method").then(response => {
      this.reliefMethodOptions = response.data;
    });
    this.getDicts("largess_method").then(response => {
      this.largessMethodOptions = response.data;
    });
    this.getDicts("system_type").then(response => {
      this.systemTypeOptions = response.data;
    });
    this.getDicts("favoured_policy_status").then(response => {
      this.statusOptions = response.data;
    });
  },
  methods: {
    // 优惠方式字典翻译
    preferentialMethodFormat(row, column) {
      return this.selectDictLabel(this.preferentialMethodOptions, row.preferentialMethod);
    },
    // 折后抹零字典翻译
    wipeOffFormat(row, column) {
      return this.selectDictLabel(this.wipeOffOptions, row.wipeOff);
    },
    // 分摊方式字典翻译
    sharingMethodFormat(row, column) {
      return this.selectDictLabel(this.sharingMethodOptions, row.sharingMethod);
    },
    // 优惠类型字典翻译
    preferentialTypeFormat(row, column) {
      return this.selectDictLabel(this.preferentialTypeOptions, row.preferentialType);
    },
    // 折扣方式字典翻译
    discountMethodFormat(row, column) {
      return this.selectDictLabel(this.discountMethodOptions, row.discountMethod);
    },
    // 减免方式字典翻译
    reliefMethodFormat(row, column) {
      return this.selectDictLabel(this.reliefMethodOptions, row.reliefMethod);
    },
    // 赠送方式字典翻译
    largessMethodFormat(row, column) {
      return this.selectDictLabel(this.largessMethodOptions, row.largessMethod);
    },
    // 系统类型字典翻译
    systemTypeFormat(row, column) {
      return this.selectDictLabel(this.systemTypeOptions, row.systemType);
    },
    // 状态字典翻译
    statusFormat(row, column) {
      return this.selectDictLabel(this.statusOptions, row.status);
    },

  }

}
